package edu.calpoly.android.lab1jmt;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class NameGetter extends Activity implements OnClickListener {

	EditText nameEntered;
	
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.name_getter);
		nameEntered = (EditText) this.findViewById(R.id.MyId02);
		
		Button aceitar = (Button) this.findViewById(R.id.MyId03);
		aceitar.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		String nameEnteredText = nameEntered.getText().toString();
		
		Intent intentHelloWorld = new Intent(this, HelloWorld.class);
		intentHelloWorld.putExtra("userName", nameEnteredText);
		
		this.startActivity(intentHelloWorld);
		
	}
	

}
